home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_b
/
sectio.act
< prev
next >
Wrap
Text File
|
1995-04-22
|
2KB
|
91 lines
MODULE ; SECTIO.ACT
; The following routines perform
; direct sector access to a disk
; drive.
PROC SIO=$E459()
MODULE
TYPE DCBREC =
[
BYTE devID,
driveNum,
driveCmd,
stat
CARD buf,
timeOut,
count,
sect
]
DCBREC POINTER DCB
SET DCB = $300
; SectIO - Call SIO to perform a read
; or write of a single sector
; parameters: drive drive #
; sector sector #
; buffer address of buffer
; density 1,2 = sgl,dbl
; returns: SIO error code
BYTE FUNC SectIO( BYTE drive, CARD sector, buffer, BYTE density )
DCB.devID = '1
DCB.driveNum = drive
DCB.buf = buffer
DCB.timeOut = 15
DCB.sect = sector
; Set byte count for proper density
IF (density = 1) OR (sector <= 3) THEN
DCB.count = 128
ELSE
DCB.count = 256
FI
SIO() ; Call SIO to perform operation
RETURN( DCB.stat )
; ReadSector - Call SIO to read a
; sector from a disk drive.
; parameters: drive drive #
; sector sector #
; buffer address of buffer
; density 1,2 = sgl,dbl
; returns: SIO error code
BYTE FUNC ReadSector( BYTE drive, CARD sector, buffer, BYTE density )
DCB.driveCmd = 'R
DCB.stat = $40
SectIO( drive, sector, buffer, density )
[ $60 ]
; WriteSector - Call SIO to read a
; sector from a disk drive.
; parameters: drive drive #
; sector sector #
; buffer address of buffer
; density 1,2 = sgl,dbl
; returns: SIO error code
BYTE FUNC WriteSector( BYTE drive, CARD sector, buffer, BYTE density )
DCB.driveCmd = 'W
DCB.stat = $80
SectIO( drive, sector, buffer, density )
[ $60 ]
MODULE ; For user